Skip to content

[D]DLS-702-feature(ui-react-visualization): Add Scrubber component#680

Merged
zel-kass merged 13 commits into
mainfrom
DLS-702-feat/scrubber-react
May 11, 2026
Merged

[D]DLS-702-feature(ui-react-visualization): Add Scrubber component#680
zel-kass merged 13 commits into
mainfrom
DLS-702-feat/scrubber-react

Conversation

@zel-kass
Copy link
Copy Markdown
Collaborator

@zel-kass zel-kass commented May 5, 2026

Overview

Introduce Scrubber component with keyboard controls, and plug it to CartesianChart.
Screenshot 2026-05-05 at 17 44 53

@zel-kass zel-kass requested a review from a team as a code owner May 5, 2026 15:45
@vercel
Copy link
Copy Markdown

vercel Bot commented May 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ldls Ready Ready Preview, Comment May 11, 2026 9:55am
ldls-react-native Ready Ready Preview, Comment May 11, 2026 9:55am

Request Review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an interactive “Scrubber” feature to ui-react-visualization charts, enabling hover/touch/keyboard-driven selection of an x-position and rendering corresponding chart overlays (line/label/beacons).

Changes:

  • Introduce Scrubber component + provider/context for pointer/touch/keyboard interactions.
  • Wire scrubbing support through CartesianChart and LineChart public APIs.
  • Add unit tests and Storybook stories for scrubber behavior.

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
libs/ui-react-visualization/src/lib/utils/scales/scales.ts Adds a helper to map a single x value to pixel space (incl. band centering).
libs/ui-react-visualization/src/lib/Components/Scrubber/utils.ts Adds pixel→data-index resolution for different x-scale modes.
libs/ui-react-visualization/src/lib/Components/Scrubber/utils.test.ts Tests for pixel→index mapping across band/linear + axis-data cases.
libs/ui-react-visualization/src/lib/Components/Scrubber/types.ts Defines scrubber props/context/provider types.
libs/ui-react-visualization/src/lib/Components/Scrubber/ScrubberProvider.tsx Attaches SVG event listeners and manages scrubber position state.
libs/ui-react-visualization/src/lib/Components/Scrubber/ScrubberProvider.test.tsx Integration-style tests for provider interactions (mouse/keys/focus).
libs/ui-react-visualization/src/lib/Components/Scrubber/Scrubber.tsx Renders scrubber visuals (line, overlay, label, beacons).
libs/ui-react-visualization/src/lib/Components/Scrubber/Scrubber.test.tsx Tests scrubber rendering toggles and basic positioning.
libs/ui-react-visualization/src/lib/Components/Scrubber/Scrubber.stories.tsx Storybook coverage for scrubber usage scenarios.
libs/ui-react-visualization/src/lib/Components/Scrubber/index.ts Public exports for scrubber module.
libs/ui-react-visualization/src/lib/Components/Scrubber/context/* Safe context + hook for scrubber state.
libs/ui-react-visualization/src/lib/Components/LineChart/types.ts Adds enableScrubbing + onScrubberPositionChange to LineChart API.
libs/ui-react-visualization/src/lib/Components/LineChart/LineChart.tsx Passes scrubbing props through to CartesianChart.
libs/ui-react-visualization/src/lib/Components/LineChart/LineChart.stories.tsx Adds a “real-time” scrubbing demo story.
libs/ui-react-visualization/src/lib/Components/index.ts Re-exports scrubber from components barrel.
libs/ui-react-visualization/src/lib/Components/CartesianChart/types.ts Adds scrubbing props to CartesianChart API.
libs/ui-react-visualization/src/lib/Components/CartesianChart/CartesianChart.tsx Mounts ScrubberProvider, makes SVG focusable when enabled.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread libs/ui-react-visualization/src/lib/Components/Scrubber/types.ts Outdated
Comment thread libs/ui-react-visualization/src/lib/Components/Scrubber/Scrubber.tsx Outdated
Comment thread libs/ui-react-visualization/src/lib/Components/Scrubber/Scrubber.tsx Outdated
Comment thread libs/ui-react-visualization/src/lib/Components/Scrubber/Scrubber.tsx Outdated
Comment thread libs/ui-react-visualization/src/lib/Components/Scrubber/Scrubber.test.tsx Outdated
Comment thread libs/ui-react-visualization/src/lib/Components/Axis/YAxis/YAxis.tsx
Copy link
Copy Markdown
Contributor

@aquelemiguel aquelemiguel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding the gradient on the scrubber, I know we've brought this up in a daily before, but now I've had time to collect my ideas... I think the reason it looks odd is in this situation where the line intersects the lightest part:

Image

It looks way better here, where the intersect point is near the graph's equator so the gradient is in its most opaque part:

Image

I'd suggest confirming with Laurine if any of these solutions could work:

  1. Remove gradient altogether, just use a solid line (we tried this before, mixed opinions).
  2. Make it so the gradient always starts at the point of intersection, not in the equator of the graph (could be difficult dev-wise).
  3. Remove both the gradient and the line (the change in transparency might be enough for the user to pinpoint the correct X coordinate).

Regardless, excellent work on this @zel-kass, as always. Nothing to point out code-wise, it's a bit cryptic and math heavy. Mostly tested interacting with it and feels great. 🫶

zel-kass added 2 commits May 7, 2026 17:52
…isual consistency; utilize ref for scrubber position management
…t; introduce constants for improved readability
Copy link
Copy Markdown
Collaborator

@aammami-ledger aammami-ledger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beautiful work on this one 👏

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 23 out of 23 changed files in this pull request and generated 5 comments.

Comments suppressed due to low confidence (2)

libs/ui-react-visualization/src/lib/Components/Axis/XAxis/XAxis.tsx:21

  • This PR changes the default gridLineStyle from dashed to solid and updates the grid line stroke token. Since the PR description only mentions adding Scrubber, this axis default styling change looks out of scope; consider documenting it in the PR description or splitting it into a separate change to keep behavior changes isolated.
export function XAxis({
  gridLineStyle = 'solid',
  position = 'bottom',
  showGrid = false,
  showLine = false,
  showTickMark = false,

libs/ui-react-visualization/src/lib/Components/Axis/YAxis/YAxis.tsx:21

  • This PR changes the default gridLineStyle from dashed to solid and updates the grid line stroke token. Since the PR description only mentions adding Scrubber, this axis default styling change looks out of scope; consider documenting it in the PR description or splitting it into a separate change to keep behavior changes isolated.
export function YAxis({
  gridLineStyle = 'solid',
  position = 'start',
  showGrid = false,
  showLine = false,
  showTickMark = false,

Comment thread libs/ui-react-visualization/src/lib/Components/Scrubber/utils.ts Outdated
Comment thread libs/ui-react-visualization/src/lib/Components/Scrubber/types.ts
Comment thread libs/ui-react-visualization/src/lib/Components/Line/Line.tsx
…nfiguration for numeric data; update types for improved clarity
@sonarqubecloud
Copy link
Copy Markdown

@zel-kass zel-kass merged commit 98db5c0 into main May 11, 2026
20 checks passed
@zel-kass zel-kass deleted the DLS-702-feat/scrubber-react branch May 11, 2026 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants